<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <datagrid :data="todos">
            <template slot="headslot">
                <tr>
                    <td>id</td>
                    <td>text</td>
                    <td>isTrue</td>
                </tr>
            </template>
            <template slot="bodyslot" slot-scope="{scope}">
                <td>{{scope.id}}</td>
                <td>{{scope.text}}</td>
                <td>{{scope.isTrue}}</td>
            </template>
        </datagrid>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script>
        Vue.component("datagrid", {
            props: {
                data: null
            },
            template: `
               <table>
                    <thead>
                        <slot name="headslot"></slot>
                    </thead>
                    <tbody>
                        <tr  v-for="item in data">
                            <slot name="bodyslot" :scope="item">{{item.text}</slot>
                        </tr>
                   </tbody>
               </table>
           `
        });

        var vm = new Vue({
            el: "#app",
            data: {
                todos: [
                    { text: "A", id: 1, isTrue: true },
                    { text: "B", id: 2, isTrue: true },
                    { text: "C", id: 3, isTrue: false },
                    { text: "D", id: 4, isTrue: true },
                ]
            }
        });


    </script>
</body>


</html>